-
Notifications
You must be signed in to change notification settings - Fork 6
Rename package from workato_platform to workato_platform_cli #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Update all import statements throughout source code - Regenerate OpenAPI client with correct package name - Restore _configure_retry_with_429_support function lost during rename - Update openapi-config.yaml packageName configuration - Fix all internal module references and dependencies
- Fix all test import statements from workato_platform to workato_platform_cli - Update patch decorators and mock references - Fix path references in test files - Ensure all 903 tests pass with new package structure
| runs-on: ubuntu-latest | ||
| outputs: | ||
| version: ${{ steps.version.outputs.version }} | ||
| environment: ${{ steps.determine-env.outputs.environment }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Required for hatch-vcs versioning | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| enable-cache: true | ||
| cache-dependency-glob: "pyproject.toml" | ||
|
|
||
| - name: Install build dependencies | ||
| run: | | ||
| uv pip install --system build hatch hatch-vcs twine | ||
|
|
||
| - name: Determine environment | ||
| id: determine-env | ||
| run: | | ||
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | ||
| echo "environment=${{ inputs.environment }}" >> $GITHUB_OUTPUT | ||
| elif [[ "${{ github.ref }}" == "refs/heads/test" ]]; then | ||
| echo "environment=test" >> $GITHUB_OUTPUT | ||
| elif [[ "${{ github.ref }}" == "refs/heads/release" ]] || [[ "${{ github.ref }}" == refs/tags/* ]]; then | ||
| echo "environment=release" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Get version and configure for environment | ||
| id: version | ||
| run: | | ||
| # Get version from git tags | ||
| BASE_VERSION=$(git describe --tags --always --match="*.*.*" | sed 's/^v//') | ||
| if [[ -z "$BASE_VERSION" || "$BASE_VERSION" == *"-"* ]]; then | ||
| # Fallback: use the latest tag or default | ||
| BASE_VERSION=$(git tag --sort=-version:refname | head -n1 | sed 's/^v//') | ||
| if [[ -z "$BASE_VERSION" ]]; then | ||
| BASE_VERSION="1.0.0rc4" | ||
| fi | ||
| fi | ||
| echo "Base version: $BASE_VERSION" | ||
|
|
||
| if [[ "${{ steps.determine-env.outputs.environment }}" == "test" ]]; then | ||
| # Test environment: append .devN | ||
| VERSION="${BASE_VERSION}.dev${{ github.run_number }}" | ||
| echo "Development version: $VERSION" | ||
| echo "SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION}" >> $GITHUB_ENV | ||
| else | ||
| # Production environment: use version as-is | ||
| VERSION="${BASE_VERSION}" | ||
| echo "Production version: $VERSION" | ||
|
|
||
| # Verify no dev suffix for production | ||
| if [[ "$VERSION" =~ "dev" ]]; then | ||
| echo "Error: Version contains 'dev' suffix. Production releases must be clean versions." | ||
| echo "Current version: $VERSION" | ||
| echo "Please create a git tag (e.g., v1.0.0) on the release branch." | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Build package | ||
| run: python -m build | ||
|
|
||
| - name: Check package | ||
| run: | | ||
| twine check dist/* | ||
| ls -lh dist/ | ||
| echo "Package version: ${{ steps.version.outputs.version }}" | ||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dist-${{ steps.determine-env.outputs.environment }} | ||
| path: dist/ | ||
|
|
||
| publish-test: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix the problem, you should add an explicit permissions: block to the build job in the workflow YAML (.github/workflows/pypi.yml). This block should specify only the permissions needed by the build job. In practice, for jobs that just need access to the code (e.g., checkout), contents: read is sufficient.
-
Add the following beneath line 23 (
runs-on: ubuntu-latest):permissions: contents: read
This change explicitly ensures that this job’s GITHUB_TOKEN can only read repository contents, and cannot write or modify anything, reducing the risk of privilege escalation or unintended actions.
-
Copy modified lines R24-R25
| @@ -21,6 +21,8 @@ | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| version: ${{ steps.version.outputs.version }} | ||
| environment: ${{ steps.determine-env.outputs.environment }} |
- Break long function signatures and imports - Add noqa comments for unavoidable long imports - Format code with ruff - All lint checks now pass
Complete package rename with PyPI deployment support
Changes
workato_platformtoworkato_platform_cli_configure_retry_with_429_supportfunctionTesting
Breaking Changes
workato-platformtoworkato-platform-cliworkato_platformtoworkato_platform_cliReady for production PyPI deployment.